package com.dx.gulimall.product.service.impl;

import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dx.common.utils.PageUtils;
import com.dx.common.utils.Query;

import com.dx.gulimall.product.dao.AttrGroupDao;
import com.dx.gulimall.product.entity.AttrGroupEntity;
import com.dx.gulimall.product.service.AttrGroupService;


@Service("attrGroupService")
public class AttrGroupServiceImpl extends ServiceImpl<AttrGroupDao, AttrGroupEntity> implements AttrGroupService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<AttrGroupEntity> page = this.page(
                new Query<AttrGroupEntity>().getPage(params),
                new QueryWrapper<AttrGroupEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public PageUtils queryPage(Map<String, Object> params,Long catelogId) {
//        if(catelogId==0){
//            IPage<AttrGroupEntity> page=this.page(new Query<AttrGroupEntity>().getPage(params),
//                    new QueryWrapper<AttrGroupEntity>());
//            return new PageUtils(page);
//        }else{
//            String key=(String)params.get("key");
//            QueryWrapper<AttrGroupEntity> wrapper=new QueryWrapper<AttrGroupEntity>().eq()
//        }

        return null;
    }
}